<template>
	<view class="box">
		<view class="box1">
			<view class="back">
				<image src="@/static/image/后退.png"></image>
			</view>
			<view class="sousuo">
				<u-search shape="round" :clearabled="true" :animation="true" bg-color="#fff"></u-search>
				<view class="a1">
					搜索
				</view>
			</view>
		</view>

		<view class="grid">
			<view class="grid-item" v-for="(item,index) in grid" :key="index" @click="nav">
				<image :src="item.icon" />
				<view class="grid-item-font">{{ item.text }}</view>
			</view>
			<!-- <view class="grid-item">
    			<image src="@/static/image/分享.png"></image>
    			<view>秒杀</view>
    		</view> -->
		</view>

		<view class="content">
			<view class="left">
				<view class="left1" v-for="(item,index) in list" :key="index">
					{{item}}
				</view>
				<!-- <ul class="ul">
					<li v-for="(item,index) in list" :key="index">
						<span></span>
					</li>
				</ul> -->
			</view>
			<view class="right">
				<view class="right-img">
					<image src="https://img1.baidu.com/it/u=1066150290,1612459096&fm=253&fmt=auto&app=120&f=JPEG?w=929&h=500" mode=""></image>
				</view>
				<view class="right-content">
					<view class="content" v-for="item in content" :key="item.id">
						<thing :title="item.title" :title1="item.title1" :title2="item.title2" :title3="item.title3"
							:title4="item.title4" :title5="item.title5">
							<template #t1>
								券
							</template>
							<template #t2>
								减10元
							</template>
						</thing>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import thing from '@/components/thing/thing.vue'
	export default {
		components: {
			thing
		},
		data() {
			return {
				grid: [{
						id: 1,
						icon: "../../static/image/团购.png",
						text: "水果"
					},
					{
						id: 2,
						icon: "../../static/image/秒杀.png",
						text: "蔬菜"
					},
					{
						id: 3,
						icon: "../../static/image/精选.png",
						text: "肉类"
					},
					{
						id: 4,
						icon: "../../static/image/领劵.png",
						text: "海鲜"
					},
					{
						id: 5,
						icon: "../../static/image/分享.png",
						text: "熟食"
					},
				],
				content: [{
						id: 1,
						title: require('../../static/image/包子.png'),
						title1: '江苏无锡香菇猪肉包',
						title2: '猪肉肥美 | 鲜甜嫩软 | 多汁美味',
						title3: '多汁香嫩',
						title4: '8.79',
						title5: '笼',
						title6: '券',
						title7: '减10元'
					},
					{
						id: 2,
						title: require('../../static/image/包子.png'),
						title1: '浙江临海西蓝花',
						title2: '基地直供 | 绿色培植 | 新鲜采摘',
						title3: '绿色新鲜',
						title4: '4.79',
						title5: '斤'
					},
					{
						id: 3,
						title: require('../../static/image/包子.png'),
						title1: '云南高山大西红柿',
						title2: '鲜嫩多汁 | 软甜爽口 | 入口美味',
						title3: '美味多汁',
						title4: '2.44',
						title5: '斤'
					},
					{
						id: 4,
						title: require('../../static/image/包子.png'),
						title1: '宁夏西吉县马铃薯',
						title2: '基地直供 | 绿色配制 | 新鲜采摘',
						title3: '绿色新鲜',
						title4: '3.21',
						title5: '斤'
					}
				],
				list: [
					'推荐', '热销爆款', '新品', '绿叶茶', '番茄', '茄果', '玉米', '花菜', '豆制品',
					'菌菇', '有机蔬菜', '进口蔬菜'
				]
			}
		},
		methods: {
			nav() {
				uni.navigateTo({
					url: '/pages/list1/list1'
				})
			}
		}
	}
</script>

<style lang="scss">
	.box {
		.box1 {
			background-image: linear-gradient(#cdf1dd, #fff);
			height: 30vh;
			border-radius: 35rpx 35rpx 0 0;

			.back {
				image {
					padding-left: 2vh;
					width: 4vh;
					height: 4vh;
					margin-top: 5vh;
				}
			}

			.sousuo {
				width: 90%;
				margin: auto;
				padding-top: 3vh;
				position: relative;

				.a1 {
					color: #fff;
					background-color: #49ba7c;
					border-radius: 40rpx;
					padding: 10rpx 35rpx;
					position: absolute;
					right: 0.5vh;
					bottom: 0.3vh;
				}
			}
		}

		.grid {
			width: 90%;
			margin: -7vh auto 0;
			display: flex;
			justify-content: space-around;
			border-radius: 30rpx;
			padding: 30rpx 0;

			.grid-item {
				image {
					width: 6vh;
					height: 6vh;
					border-radius: 100%;
				}

				.grid-item-font {
					text-align: center;
				}
			}
		}

		.content {
			width: 90%;
			margin: auto;
			display: flex;
			justify-content: space-between;

			.left {
				width: 30%;
				.left1{
					height: 108rpx;
					text-align: center;
					line-height: 108rpx;
					background-color: #fafafa;
					color: gray;
				}
				.left:hover{
					border-left: #49ba7c;
				}
			}

			.right {
				width: 68%;
				margin-bottom: 40px;

				.right-img {
					image {
						width: 100%;
						height: 200rpx;
						border-radius: 20px;
					}
				}
			}
		}
	}
</style>